<template>
  <div>
    <h1>修改页面</h1>
    <hr />
    <div>
      <el-input v-model="info.name" placeholder="请输入内容"></el-input>
      <el-input v-model="info.age" placeholder="请输入内容"></el-input>
      <el-input v-model="info.gender" placeholder="请输入内容"></el-input>
      <el-input v-model="info.phone" placeholder="请输入内容"></el-input>
    </div>

    <button @click="sureChange(info.id)">确认修改</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      info: {},
    };
  },
  mounted() {
    let self = this;
    self.info = this.$route.query.item;
  },

  methods: {
    sureChange() {
      // console.log(self.info)
      this.$store.dispatch("changeInfo", this.info);
      //   跳转回首页

      this.$router.push({ path: "/" });
    },
  },
};
</script>

<style>
</style>